#!/bin/sh

path=/home/xinyu/java/src/org/idontknow/helloworld
rm $path/classes/*.class
rm $path/classes/**/*.class

if [ -f $path/traces.log ]
then
  rm $path/traces.log
fi

javac -d $path/classes -sourcepath $path $path/Hello.java
#printf "compilation finished!\n"
java -cp $path/classes -Dpwd="$path" Hello

if [ -f $path/traces.log ]
then
  printf "\noof..u got logs to a file? ok, lets c...\n-------- contents of ur output file: --------\n"
  str=`cat $path/traces.log`
  printf "$str\n-------- end of output file display! --------\n\n"
fi
